package com.test.hello.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.test.hello.basic.BasicDAO;
import com.test.hello.dao.UserRoleMapper;
import com.test.hello.model.UserRole;

@Service
public class UserRoleService implements BasicDAO<UserRole>{
	@Autowired
	private UserRoleMapper mapper;
	public int deleteByPrimaryKey(Long id) {
		
		return mapper.deleteByPrimaryKey(id);
	}

	public int insertSelective(UserRole entity) {
		
		return mapper.insertSelective(entity);
	}

	public UserRole selectByPrimaryKey(Long id) {
		
		return mapper.selectByPrimaryKey(id);
	}

	public int updateByPrimaryKeySelective(UserRole entity) {
		
		return mapper.updateByPrimaryKeySelective(entity);
	}
	/**
     * 根据用户id查询角色
     * @param userid
     * @return
     */
    List<UserRole> findByUserid(Long userid){
    	return mapper.findByUserid(userid);
    }

}
